<template>
	<view>
		<view class="header">看app文案</view>
		<view class="box">
			<view class="">发送短信剩余</view>
			<view class="box-r">{{ mms }}条</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			mms:0,
			phoneNumber:0,
		};
	},
	onLoad() {
		this.chaXun(
		this.add()
		);
		
	},

	methods: {
		show() {
			uni.showModal({
				title: '短信剩余0条',
				content: '是否联系客服人员充值?',
				success: function(res) {
					if (res.confirm) {
						uni.makePhoneCall({
						    phoneNumber: '15105208888' //仅为示例
						});
					} else if (res.cancel) {
						console.log('用取消');
					}
				}
			});
		},
		add() {
			if (this.mms == 0) {
				this.show();
			}
		},
		chaXun(){
			
			   let that = this;
			   that.$ajax(
			    'api/v1.shop/smsNum',
			    {
			   
			    },
			    'GET'
			   ).then(res => {
			  this.mms=res.result;
			  console.log(this.mms);
			   });
			  
		}
	}
};
</script>

<style>
page {
	background-color: #f5f5f5;
}
.header {
	height: 88rpx;
	line-height: 88rpx;
	margin-left: 32rpx;
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: rgba(102, 102, 102, 1);
}
.box {
	height: 109rpx;
	line-height: 109rpx;
	display: flex;
	justify-content: space-between;
	background-color: #ffffff;
	padding: 0 32rpx;
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: 500;
}
</style>
